// 此文件专门创建自定义指令
export const imgerror = {
  inserted (el, pm) {
    // 需求为空,也要给默认图片
    el.src = el.src || pm.value
    el.onerror = function () {
      el.src = pm.value
    }
  },
  componentUpdated (el, pm) {
    el.src = el.src || pm.value
  },
}
